package com.itheima.d9_test;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

public class Demo1 {
    public static void main(String[] args)throws Exception {
        List<String> gift =new ArrayList<>();
        String[] names ={"口红","包包","香水","皮带","手表","大三"};

        Random r =new Random();
        for (int i = 0; i < 100; i++) {
            gift.add(names[r.nextInt(names.length)]+(i+1));
        }
        System.out.println(gift);

        SendThread ry = new SendThread(gift,"谢睿妍");
        ry.start();
        SendThread yb = new SendThread(gift,"杨斌");
        yb.start();

        ry.join();
        yb.join();

        System.out.println("谢睿妍抽取了"+ry.getCount()+"个礼物");
        System.out.println("杨斌抽取了"+yb.getCount()+"个礼物");
    }
}
